package com.moon.spring.test;

import com.moon.spring.config.SpringConfig;
import com.moon.spring.service.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @ClassName: SpringTest03
 * @Description: TODD
 * @Author: 郭正洋
 * @Date: 2022/10/10 15:07
 * @Vsersion: 1.0.0
 **/
public class SpringTest03 {

	/*
	 * @Description: 注解模式获取对象
	 * @Author: 郭正洋
	 * @Date: 2022/10/10 15:08
	 * @param args
	 * @Version: v1.0.0
	 **/
	public static void main(String[] args) {
		AnnotationConfigApplicationContext auto = new AnnotationConfigApplicationContext(SpringConfig.class);
		UserService userService = auto.getBean("userService", UserService.class);
		System.out.println(userService.add());
	}
}
